/* 자바에서 도스 명령어 실행하기 */

package b_systemAPI;

import java.io.*;
public class ConsolExecute {
	InputStream input;
	InputStreamReader reader;
	BufferedReader receive;
	
	public ConsolExecute(){
		try{
			System.out.println("cmd cls....(Java API ~ 1.4)");
			Runtime rt = Runtime.getRuntime();
			String c = "cmd.exe /c  notepad";
			Process p = rt.exec(c);
			input = p.getInputStream();
			reader = new InputStreamReader(input);
			receive = new BufferedReader(reader);
			System.out.println(receive.readLine());
			
		}catch(Exception ex){
			ex.printStackTrace();			
		}
	}
	public static void main(String[] args) {
		new ConsolExecute();
	}

}
